import router from '@system.router';

export default {
    data: {
        durationRange: ["one", "two", "three"],
        durationSelected: 1,
        rhythmRange: ["Primary", "Middle", "Best"],
        rhythmSelected: 1
    },
    onInit() {
        console.log("主页面正在初始化...");
    },
    onReady() {
        console.log("主页面就绪...");
    },
    onShow() {
        console.log("主页面正在显示...");
    },
    onDestroy() {
        console.log("主页面正在销毁...");
    },
    onDurationChange(pv) {
        console.log("时长改变：" + pv.newSelected);

        this.durationSelected = pv.newSelected;
    },
    onRhythmChange(pv) {
        console.log("节奏改变：" + pv.newSelected);

        this.rhythmSelected = pv.newSelected;
    },
    onClick() {
        router.replace({uri: "pages/countdown/countdown", params: {
            "durationSelected": this.durationSelected,
            "rhythmSelected": this.rhythmSelected}});
    }
}
